<?
// Safely assumes $_GET variable 'brand' is set.
$brandId  = $_GET['brand'];
$brandName  = lookup_brandById($brandId);

?>

<div id="navigation">
    <h2><?=$brandName?></h2>
    <div id="nav_types">
	<ul class="navList">
	    <?
	    $categories = array();
	    $categories = getTypesByBrand($brandId);
	    
	    foreach($categories as $cat) {
		echo "<li>";
		echo '<a href="browse.php?type='.$cat.'&&brand='.$brandId.'">';
		echo lookup_typeById($cat);
		echo " <span class=\"parentheticalCount\">(".countProducts($cat, $brandId).")</span>";
		echo "</a></li>";
	    }
	    
	    ?>
	</ul>
    </div>
</div>